class Cartasur::Forum < Cartasur::CartasurModel
  attr_accessible :description, :name

  has_many :topics, :dependent => :destroy, :foreign_key => 'forum_id'


  # app/models/forum.rb
  def most_recent_post
    topic = Cartasur::Topic.first(:order => 'last_post_at DESC', :conditions => ['forum_id = ?', self.id])
    topic
  end
end
